Xbasic

INET::SSLContextCreateCertificateRequest Method

Syntax

Result_Flag as L = CreateCertificateRequest(CertificateFile as C, PrivateKeyFile as C, PrivateKeyPassword as C [, CountryCode as C [, State as C [, Locality as C [, Organization as C [, OrganizationalUnit as C [, CommonName as C [, Email as C ]]]]]]])

Arguments

CertificateFileCharacter

The path and name of the certificate file.

PrivateKeyFileCharacter

The path and name of the private key file.

PrivateKeyPasswordCharacter

The password for the private key file.

CountryCodeCharacter

Default = "US".

StateCharacter

Default = "MA".

LocalityCharacter

Default = "Burlington".

OrganizationCharacter

Default = "Alpha Software Customer".

OrganizationalUnitCharacter

Default = "Development Test".

CommonNameCharacter

Default = "www.mydomain.com". You can provide multiple names as a CRLF delimited string.

EmailCharacter

Default = "".

Returns

Result_FlagLogical

TRUE (.T.) if the operation was successful; otherwise FALSE (.F.).

Description

Create a request for a certificate.

Discussion

The INET::SSLContext::CreateCertificateRequest() method creates a request for a SSL Server Certificate.

Example

dim ctx as INET::SSLContext
if ctx.CreateCertificateRequest(RequestFile, KeyFile, Password, "US", "MA", "Burlington", "Alpha Software, Inc.", "Dev", "Dev Test Request")
    Result = "Request successfully created"
else
    Result = "Error creating certificate request: " + ctx.callresult.text
end if

ui_msg_box("Create certificate request: " + RequestFile, Result)

See Also